﻿////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// <copyright>Copyright 2008-2011 Andreas Huber Doenni</copyright>
// Distributed under the Microsoft Public License (Ms-PL).
// See accompanying file License.txt or copy at http://mews.codeplex.com/license.
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

namespace Mews.Net.Nntp
{
    using System;
    using System.Diagnostics.CodeAnalysis;
    using System.IO;
    using System.Text;

    /// <summary>Represents the base of all NNTP multiline responses where an object of the type representing a single
    /// line of the response can be created by passing four arguments.</summary>
    /// <typeparam name="TMostDerived">The most-derived subclass of this type.</typeparam>
    /// <typeparam name="TResponseLine">The type that exposes the data that is parsed from a single line of the
    /// response.</typeparam>
    /// <typeparam name="TP1">The type of the first parameter needed to create a <typeparamref name="TResponseLine"/>
    /// object, see remarks.</typeparam>
    /// <typeparam name="TP2">The type of the second parameter needed to create a <typeparamref name="TResponseLine"/>
    /// object, see remarks.</typeparam>
    /// <typeparam name="TP3">The type of the third parameter needed to create a <typeparamref name="TResponseLine"/>
    /// object, see remarks.</typeparam>
    /// <typeparam name="TP4">The type of the fourth parameter needed to create a <typeparamref name="TResponseLine"/>
    /// object, see remarks.</typeparam>
    /// <remarks>See <see cref="MultilineResponseBase{T, U, V, W, X, Y}"/> for more information.</remarks>
    /// <threadsafety static="true" instance="false"/>
    [SuppressMessage("Microsoft.Design", "CA1005:AvoidExcessiveParametersOnGenericTypes", Justification = "We absolutely need more than two type parameters.")]
    public abstract class MultilineResponse<TMostDerived, TResponseLine, TP1, TP2, TP3, TP4> :
        MultilineResponseBase<TMostDerived, TResponseLine, TP1, TP2, TP3, TP4>
        where TMostDerived : MultilineResponse<TMostDerived, TResponseLine, TP1, TP2, TP3, TP4>
    {
        /// <summary>Initializes a new instance of the <see cref="MultilineResponse{TMostDerived, TResponseLine, TP1, TP2, TP3, TP4}"/> class.</summary>
        /// <param name="subsequentLines">A stream containing all lines of the response except the initial line.</param>
        /// <exception cref="ArgumentNullException"><paramref name="subsequentLines"/> equals <c>null</c>.</exception>
        protected MultilineResponse(Stream subsequentLines) : base(subsequentLines, Encoding.UTF8)
        {
        }
    }
}
